<HTML><HEAD><TITLE>disasm(+PredSpec, ?WAMCode, +Module)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(asm)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>disasm(+PredSpec, ?WAMCode, +Module)</H1>
Disassemble an existing predicate PredSpec in the module Module to its WAM
abstract machine representation WAMCode.


<DL>
<DT><EM>+PredSpec</EM></DT>
<DD>Atom/Integer.
</DD>
<DT><EM>?WAMCode</EM></DT>
<DD>Variable or a list of WAM instructions in the right format.
</DD>
<DT><EM>+Module</EM></DT>
<DD>Atom
</DD>
</DL>
<H2>Description</H2>
   Unifies WAMCode with the WAM instructions representing the abstract
   machine code for the predicate specified by PredSpec (in Name/Arity
   form) in module Module. The WAM code is in the form of a list, with each
   element representing one WAM instruction. The format of the WAMCode is
   the same as that used by asm/2,3 and pasm/4 to assemble a
   predicate. Thus, the WAM code generated by disasm/2,3 can be used to
   load the predicate into ECLiPSe without having to compile the source
   Prolog form.

<P>
   The library asm must be loaded to use diasm/3.

<P>
   Currently disasm/3 cannot disassemble dynamic predicates.

<P>
   If PredSpec is dynamic.

<P>

<H3>Fail Conditions</H3>
   Fails if WAMCode is initially instantiated and does not unify with the WAM code generated by asm/1 for the predicate, or if PredSpec is dynamic.
<H3>Resatisfiable</H3>
   No.
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>PredSpec or Module not in correct form.
<DT><EM>(60) referring to an undefined procedure </EM>
<DD>PredSpec does not exist in module Module.
<DT><EM>(80) not a module </EM>
<DD>Module is not an existing module.
</DL>
<H2>See Also</H2>
<A HREF="../../lib/asm/disasm-2.html">disasm / 2</A>, <A HREF="../../lib/asm/asm-2.html">asm / 2</A>, <A HREF="../../lib/asm/asm-3.html">asm / 3</A>, <A HREF="../../lib/asm/pasm-4.html">pasm / 4</A>, <A HREF="../../lib/asm/wam-1.html">wam / 1</A>
</BODY></HTML>
